# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-tlv8
pkgver=0.10.0
pkgrel=1
pkgdesc="Module to handle type-length-value (TLV) encoded data 8-bit type, 8-bit length, and N-byte value"
url="https://github.com/jlusiardi/tlv8_python"
arch="noarch"
license="Apache-2.0"
depends="python3"
makedepends="
	py3-gpep517
	py3-installer
	py3-setuptools
	py3-wheel
	"
checkdepends="py3-pytest"
source="tlv8-$pkgver.tar.gz::https://github.com/jlusiardi/tlv8_python/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/tlv8_python-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m unittest discover
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
46c1e85f5a9aec80771d0a3a56ebe72cd09f531f221dd015c0486fc1986d3a5624bcb2533850c88db9d7b462993820012e7c04c641f0d3e0e1466cb2ea12d94f  tlv8-0.10.0.tar.gz
"
